# Contributor: Adam Nye <adam@spoontech.biz>
# Maintainer:
pkgname=zim
pkgver=0.74.3
pkgrel=2
pkgdesc="Desktop wiki editor"
url="http://zim-wiki.org"
arch="noarch !s390x !riscv64" # adwaita-icon-theme -> librsvg -> rust
license="GPL-2.0-or-later"
depends="python3 py3-gobject3 py3-xdg xdg-utils gtk+3.0"
makedepends="desktop-file-utils ttf-cantarell"
checkdepends="adwaita-icon-theme xvfb-run"
subpackages="$pkgname-doc $pkgname-lang"
source="https://zim-wiki.org/downloads/zim-$pkgver.tar.gz"

build() {
	python3 setup.py build
}

check() {
	# Disable widgets test module for now as some tests
	# fail because of problems related to system locale.
	cat /dev/null > tests/widgets.py
	XDG_RUNTIME_DIR=/tmp xvfb-run python3 test.py --fast
}

package() {
	python3 setup.py install --prefix=/usr --root="$pkgdir"

	install -dm755 "$pkgdir"/usr/share/icons
	cp -r xdg/hicolor "$pkgdir"/usr/share/icons
}

sha512sums="
92a530a827b9eb83289e7ffbf3f0e8ca3d9a7a770c0e6a6114541b290f76c6fd00248543170a5444d65bbd7ac7578101658db9639cf569c76324ec7b03344f9a  zim-0.74.3.tar.gz
"
